package Server.Tasks;

import Server.PhoneServerThread;
import Server.Call;

public class PickUpTask extends ServerTask{

	public PickUpTask (PhoneServerThread p, int priority, String d)
	{
		super(p, priority, d);
	}
	
	public void ProcessTask()
	{
		Call call = phone.getCurrentCall();
		
		call.startCall();
		call.getCaller().sendMessage(new StartCallTask(2, call.getCallee().getPhoneName(), call.getCaller()));
		call.getCallee().sendMessage(new StartCallTask(2, call.getCaller().getPhoneName(), call.getCallee()));
	}
}
